/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.dundd.soap.server;

import cz.muni.fi.pa165.dundd.dto.TroopDTO;
import cz.muni.fi.pa165.dundd.service.TroopService;
import java.util.List;
import javax.annotation.Resource;
import javax.jws.WebService;
import javax.xml.ws.WebServiceContext;
import org.springframework.beans.factory.annotation.Autowired;

/**
 *
 * @author xszanto1
 */
@WebService(endpointInterface = "cz.muni.fi.pa165.dundd.soap.server.TroopSOAP", serviceName = "TroopSOAP")
public class TroopSOAPImpl implements TroopSOAP{

    @Resource
    WebServiceContext wsCtx;
    
    @Autowired
    TroopService troopService;

    public void setTroopService(TroopService troopService) {
        this.troopService = troopService;
    }
    
    @Override
    public void createTroop(TroopDTO troop) {
        troopService.createTroop(troop);
    }

    @Override
    public void updateTroop(TroopDTO troop) {
        troopService.updateTroop(troop);
    }

    @Override
    public void deleteTroop(TroopDTO troop) {
        troopService.deleteTroop(troop);
    }

    @Override
    public List<TroopDTO> retrieveAllTroops() {
        return troopService.retrieveAllTroops();
    }

    @Override
    public TroopDTO retrieveTroopById(Long id) {
        return troopService.retrieveTroopById(id);
    }
    
}
